import React from 'react'
import ReactDOM from 'react-dom'
import { connect, Provider } from 'react-redux'
import { createStore } from 'redux'

import {createMove, backMove, move} from './manager.js'
import Game from './game.js'
const mapStateToProps = (state) => (state)
const mapDispatchToProps = dispatch => {
    return {
        handleClick: id => {
            dispatch(createMove(id))
        },
        jumpTo: id => {
            dispatch(backMove(id))
        }
    }
}
const GameWrapper = connect(
    mapStateToProps,
    mapDispatchToProps
  )(Game)

const store = createStore(move)  

ReactDOM.render( <Provider store={store}>
    <GameWrapper />
  </Provider>, document.getElementById('root'))  